<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="cn.egame.interfaces.fl.FileUsedType"%>
<%@ page import="java.util.*" %>
<%@ page import="cn.egame.interfaces.pu.AppParameter" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/main.css"  />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/common.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/ajaxfileupload.js"></script>
<script type="text/javascript">

function saveFile(id,name,validate,fileId){
	//检查图片
	var filepath = document.getElementById(id).value;
	if(filepath==""){
	    alert("请选择上传的文件！");
	    return;
	}else {
		var extname = filepath.substring(filepath.lastIndexOf(".")+1,filepath.length);
		extname = extname.toLowerCase();		
		if(validate.indexOf(extname)<0){
            alert("文件类型必须为" + validate + "中的一种");
            return;
		}
	}
	var domain="<%=request.getContextPath() + "/tv/game/file/save.do?name=" %>" + name ;
	jQuery.ajaxFileUpload({
		url:domain,
		secureuri:false,
		fileElementId:id,
		dataType:"text",
		success: function (data) {		
			if(data.indexOf(">")>0){
				data = data.split(">")[1];
			}
			if(data.indexOf("<")>0){
				data = data.split("<")[0];
			}
			//data = data.split(">")[1].split("<")[0];
			if(data.split(",")[0] == '-1'){
				alert("上传失败，请重传！");
				return;
			}else{
				document.getElementById(fileId).value =  data.split(",")[0];
				document.getElementById(fileId+"href").href =  data.split(",")[2];
				document.getElementById(fileId+"href").style.display = "block";
			}
          }
	});
}

function savePic(id,name,width,height,type){
	//检查图片
	var filepath = document.getElementById(id).value;
	if(filepath==""){
	    alert("请选择上传的图片！");
	    return;
	}else {
		var extname = filepath.substring(filepath.lastIndexOf(".")+1,filepath.length);
		extname = extname.toLowerCase();
		if(extname!= "jpg"&&extname!= "jpeg"&&extname!= "gif"&&extname!= "png"){
            alert("图片类型必须是.jpg,jpeg,gif,png中的一种");
            return;
		}
	}
	var domain="<%=request.getContextPath() + "/tv/activity/image/width/height.do?name=" %>" + name +"&width=" + width + "&height=" + height + "&type=" + type;
	jQuery.ajaxFileUpload({
		url:domain,
		secureuri:false,
		fileElementId:id,
		dataType:"text",
		success: function (data) {	
			if(data.indexOf(">")>0){
				data = data.split(">")[1];
			}
			if(data.indexOf("<")>0){
				data = data.split("<")[0];
			}
			//data = data.split(">")[1].split("<")[0];
			if(data.split(",")[0] == '-1'){
				alert("您上传的图片尺寸不符合规格!");
				return;
			}else{
				document.getElementById("efsId" + id).value =  data.split(",")[0];
				document.getElementById("picId"+id).src = data.split(",")[1];
			}
          }
	});
}
	$(document).ready(function() {
		//道具
		$("#propDiv").hide();
		//价格
		$("td.g_price").hide();
		//回调地址
		$("#callback").hide();
		//六条数据
		$("#chargeDiv").hide();
		//一条数据
		$("#chargingDiv").hide();
		
		$(".operMethod").click(function(){
			if($(this).is(":checked")==true){
				$(this).attr("value",1);
			}else{
				$(this).attr("value",0);
			}
		});
		
		$("#billPrice").bind("keyup",function(){
			var rmb = $(this).val();
			$("#chargingDiv tr.chargePoint td input.p_chargeName").attr("value",rmb + "元");
			$("#chargingDiv tr.chargePoint td input.p_function").attr("value",rmb + "元");
			$("#chargingDiv tr.chargePoint td input.p_triger").attr("value",rmb + "元");
			$("#chargingDiv tr.chargePoint td input.p_guide").attr("value",rmb + "元");
			$("#chargingDiv tr.chargePoint td input.p_price").attr("value",rmb*100);
		});
		
		$("#payCode").find("option.netPay").hide();
		$("#payCode").find("option.singlePay").hide();
		
		$("#upBtn1").click(function() {
			$("#searchTable tbody").remove();
			var popShortName = document.getElementById("popShortName").value;
			$.ajax({			
				url : "<%=request.getContextPath() + "/tv/game/manufacturer/search.do" %>",
				type : 'post',
				data:{
					'popShortName':popShortName
				},
				success : function(msg) {
					$("#searchTable").append("<tbody></tbody>");
					$("#searchTable tbody tr").remove();
					$("#searchTable tbody td").remove();
					var i=0;
					if(msg != null){
						$.each(msg,function(key,values){  
							++i;
							var trString = '<tr class="search_tr">';
							var endString = '</tr>';
						    var tdString = '<td align="left" width="15%" class="d_search"><input type="radio" name="checkbox_model" class="t_search" value="'+
						    		key+'"><span>'+values+'</span></td>';
						    if(i%4==1){
						    	$("#searchTable tbody").append(trString).append(tdString);
						    }else if(i%4==0){
						    	$("#searchTable tbody").append(tdString).append(endString);
						    }else{
						    	$("#searchTable tbody").append(tdString);
						    }
						});  
					}
				}
			});
		});
		
		$("#queding").click(function() {
			var model = $('input[name="checkbox_model"]:checked').val();
			var sp_text = $('input[name="checkbox_model"]:checked + span').text();
			$("#terId").attr("value",model);
			$("#cpShort").attr("value",sp_text);
			closeDialog('fileInfo');
		});
		
		$("#cancel").click(function() {
			closeDialog('fileInfo');
		});
	});
	
	function changeFeeCode(){
		var payCode = document.getElementById("payCode");
		payCode.value=-1;
		if($("#networkTypeNum").val()==11){
			$("#payCode").find("option.singlePay").show();
			$("#payCode").find("option.netPay").hide();
		}else if($("#networkTypeNum").val()==12){
			$("#payCode").find("option.netPay").show();
			$("#payCode").find("option.singlePay").hide();
		}else{
			$("#payCode").find("option.netPay").hide();
			$("#payCode").find("option.singlePay").hide();
		}
		showFeeCode();
	}
	
	function showFeeCode(){
		//支付类型
		var payCode = document.getElementById("payCode");
		//产品类型
		var networkTypeNum = document.getElementById("networkTypeNum");
		//计费类型
		var feeCode = document.getElementById("feeCode");
		//验证价格框显示
		if(((payCode.value==1)||(payCode.value==10))&&(feeCode.value==1)&&((networkTypeNum.value==11)||(networkTypeNum.value==12))){
			$("td.g_price").show();
			$("#chargingDiv").show();
		}else{
			$("td.g_price").hide();
			$("#chargingDiv").hide();
		}
		//单机下载计费
		if((networkTypeNum.value==11)&&(payCode.value==1)) {
			feeCode.value=1;
			$("td.g_price").hide();
			$("#chargingDiv").hide();
			$("#propDiv").hide();
			$("#callback").hide();
			$("#chargeDiv").hide();
			$("td.g_price").show();
			$("#chargingDiv").show();
		}else if((networkTypeNum.value==12)&&(payCode.value==10)){
			//联网下载计费
			feeCode.value=1;
			$("td.g_price").hide();
			$("#chargingDiv").hide();
			$("#propDiv").hide();
			$("#callback").hide();
			$("#chargeDiv").hide();
			$("td.g_price").show();
			$("#chargingDiv").show();
		}else if((networkTypeNum.value==12)&&(payCode.value==3)){
			//联网道具计费
			feeCode.value=1;
			$("td.g_price").hide();
			$("#chargingDiv").hide();
			$("#propDiv").hide();
			$("#callback").hide();
			$("#chargeDiv").hide();
			$("#callback").show();
			$("#chargeDiv").show();
		}else if((networkTypeNum.value==11)&&(payCode.value==2)) {
			//单机关卡计费
			feeCode.value=1;
			$("td.g_price").hide();
			$("#chargingDiv").hide();
			$("#propDiv").hide();
			$("#callback").hide();
			$("#chargeDiv").hide();
			$("#propDiv").show();
		}else if((payCode.value==0)||(payCode.value==5)){
			//免费
			feeCode.value=3;
			$("td.g_price").hide();
			$("#chargingDiv").hide();
			$("#propDiv").hide();
			$("#callback").hide();
			$("#chargeDiv").hide();
		}else{
			feeCode.value=1;
			$("td.g_price").hide();
			$("#chargingDiv").hide();
			$("#propDiv").hide();
			$("#callback").hide();
			$("#chargeDiv").hide();
		}
	}
	
	function showDetail() {
		setDialog('fileInfo');
	}
	
	function addPropRow(){
		//判断当前行数
		var columns = $("#propTable tr.proprows").size();
		
		var propTable = $("#propTable");
		var typeHtml = $("#propTable select.p_type").html().toString();
		
		var changeName = "chargeName"+columns;
		var changeFunction = "function"+columns;
		var changeCondition = "trigerCondition"+columns;
		var changeGuide = "bugGuide"+columns;
		var changePrice = "price"+columns;
		var changeType = "chargeType"+columns;
		var tr = '<tr class="proprows"><td>'+
					'<input type=text name="'+changeName+'" class="p_chargeName">'+
					'</td><td><input type=text name="'+changeFunction+'" class="p_function">'+
					'</td><td><input type=text name="'+changeCondition+'" class="p_triger">'+
					'</td><td><input type=text name="'+changeGuide+'" class="p_guide">'+
					'</td><td><input type=text name="'+changePrice+'" class="p_price">'+
					'</td><td><select name="'+changeType+'" class="p_type">'+typeHtml+
					'</select></td><td><input type=hidden name="list">'+
					'<a href="javascript:void(0)" onclick="deletePropRow(this)">删除</a></td></tr>';
		propTable.append(tr);
	}
	
	function deletePropRow(obj){
		$(obj).parent().parent().remove();
	}
	
	function formSubmit(){
		var isSubmit = true;
				
		if($("#strategy").val()==""){
		    alert("请上传游戏攻略！");
		    isSubmit = false;
		    return;
		}
		
		if($("#gameDemoPath").val()==""){
		    alert("请上传游戏Demo！");
		    isSubmit = false;
		    return;
		}
				
		if($("#copyrightPath").val()==""){
		    alert("请上传版权证明！");
		    isSubmit = false;
		    return;
		}
		if(document.getElementById("efsIdjietu1").value == ""){
			alert("请上传jietu1");
			isSubmit = false;
			return;
		}
		if(document.getElementById("efsIdjietu2").value == ""){
			alert("请上传jietu2");
			isSubmit = false;
			return;
		}
		if(document.getElementById("efsIdjietu3").value == ""){
			alert("请上传jietu3");
			isSubmit = false;
			return;
		}
		if(document.getElementById("efsIdjietu4").value == ""){
			alert("请上传jietu4");
			isSubmit = false;
			return;
		}
		if(document.getElementById("efsIdpic1").value == ""){
			alert("请上传pic1");
			isSubmit = false;
			return;
		}
		
		var td = $("#form1").find("td[name='notnone']");
		
		for(var i = 0; i<td.length; i++){
			if($(td[i]).find("input[type='text']").val() == ""){
				$(td[i]).find("span").remove();
				$(td[i]).append("<span class='page_tip'>*必填</span>");
				isSubmit = false;
				return;
			}else{
				$(td[i]).find("span").remove();
			}
		}
		//验证下拉列表框
		if($("#form1").find("td select.cplx").val()==-1) {
			alert("请选择产品类型！");
			isSubmit = false;
			return;
		}
		if($("#form1").find("td select.cpfl").val()==-1) {
			alert("请选择产品分类！");
			isSubmit = false;
			return;
		}
		if($("#form1").find("td select.cpzlx").val()==-1) {
			alert("请选择产品子类型！");
			isSubmit = false;
			return;
		}
		if($("#form1").find("td select.zflx").val()==-1) {
			alert("请选择支付类型！");
			isSubmit = false;
			return;
		}
		if($("#form1").find("td select.jflx").val()==-1) {
			alert("请选择计费类型！");
			isSubmit = false;
			return;
		}
		//提交判断
		var propValue = "";
		//数据分行标识
		var branchMark="%";
		//单机/联网按次，记录价格，一条数据
		if((($("#networkTypeNum").val()==11)&&($("#payCode").val()==1)&&($("#feeCode").val()==1))||(($("#networkTypeNum").val()==12)&&($("#payCode").val()==10)&&($("#feeCode").val()==1))) {
		//if((($("#networkTypeNum").val()==11)||($("#networkTypeNum").val()==12))&&($("#payCode").val()==1)&&($("#feeCode").val()==1)) {
			var bill = $("#billPrice").val();
			if(bill==""){
				bill=0;
			}
			bill1=bill*100;
			propValue =bill+"元/"+bill+"元/"+bill+"元/"+bill+"元/"+bill1+"/"+"1"; 
			$("#propInfo").attr("value",propValue);
			
		}
		//联网道具，六条数据
		if(($("#networkTypeNum").val()==12)&&($("#payCode").val()==3)&&($("#feeCode").val()==1)) {
			propValue ="1元/"+"1元/"+"1元/"+"1元/"+100+"/"+"2" + branchMark + "2元/"+"2元/"+"2元/"+"2元/"+200+"/"+"2" + branchMark + "5元/"+"5元/"+"5元/"+"5元/"+500+"/"+"2" + branchMark
				 + "10元/"+"10元/"+"10元/"+"10元/"+1000+"/"+"2" + branchMark + "15元/"+"15元/"+"15元/"+"15元/"+1500+"/"+"2" + branchMark + "20元/"+"20元/"+"20元/"+"20元/"+2000+"/"+"2"; 
			$("#propInfo").attr("value",propValue);
		}
		//单击关卡，道具信息
		if(($("#networkTypeNum").val()==11)&&($("#payCode").val()==2)&&($("#feeCode").val()==1)) {
			var propMessage="";
			$("#propTable tr.proprows").each(function(){
				propMessage  = propMessage + $(this).find("input.p_chargeName").val() + "/";
				propMessage  = propMessage + $(this).find("input.p_function").val() + "/";
				propMessage  = propMessage + $(this).find("input.p_triger").val() + "/";
				propMessage  = propMessage + $(this).find("input.p_guide").val() + "/";
				propMessage  = propMessage + $(this).find("input.p_price").val() + "/";
				propMessage  = propMessage + $(this).find("select.p_type").val();
				propMessage  += branchMark;
			});
			propMessage = propMessage.substring(0,propMessage.length-1);
			$("#propInfo").attr("value",propMessage);
		}
		if(isSubmit){
			document.getElementById("form1").submit();
		}else{
			return;
		}
	}
</script>
<title>创建产品</title>
</head>
<body>
<%
	Map<String, Object> cpMap = new HashMap<String, Object>();
	if(request.getAttribute("cpMap")!=null){
		cpMap = (Map<String, Object>)request.getAttribute("cpMap");
	}
	
	List<AppParameter> networktype = new ArrayList<AppParameter>();
	if(request.getAttribute("networktype")!=null){
		networktype = (List<AppParameter>)request.getAttribute("networktype");
	}

	List<AppParameter> producttype = new ArrayList<AppParameter>();
	if(request.getAttribute("producttype")!=null){
		producttype = (List<AppParameter>)request.getAttribute("producttype");
	}

	List<AppParameter> ostype = new ArrayList<AppParameter>();
	if(request.getAttribute("ostype")!=null){
		ostype = (List<AppParameter>)request.getAttribute("ostype");
	}

	List<AppParameter> paytype = new ArrayList<AppParameter>();
	if(request.getAttribute("paytype")!=null){
		paytype = (List<AppParameter>)request.getAttribute("paytype");
	}

	List<AppParameter> onlinepaytype = new ArrayList<AppParameter>();
	if(request.getAttribute("onlinepaytype")!=null){
		onlinepaytype = (List<AppParameter>)request.getAttribute("onlinepaytype");
	}
	
	List<AppParameter> feetype = new ArrayList<AppParameter>();
	if(request.getAttribute("feetype")!=null){
		feetype = (List<AppParameter>)request.getAttribute("feetype");
	}
	
	List<AppParameter> chargetype = new ArrayList<AppParameter>();
	if(request.getAttribute("chargetype")!=null){
		chargetype = (List<AppParameter>)request.getAttribute("chargetype");
	}
%>
<div id="scrollPic" style="height: 1100px;overflow: scroll;">
<div class="matter_box">
	<div class="mt10 pt10 clearfix">
<form id="form1" action="<%=request.getContextPath() + "/tv/game/new.do" %>" method="post" enctype="multipart/form-data">
	<input type="hidden" id="terId" name="terId" value="0">
	<table class="table2">
		<tr>
			<td>厂商名称</td>
			<td  name="notnone">
				<input type="text" maxlength="30" name="cpShort" id="cpShort" readonly="readonly">
			 	<a id="cpId" name="cpId" href="javascript:showDetail()" class="btn2">查询</a>
				<!-- <select name="cpId" id="cpId" class="cjmc">
					<option value=-1>请选择</option>
				<%
					Set<String> keySet = cpMap.keySet();
					Iterator<String> iterator = keySet.iterator();
					for(String key:keySet){
						%>
						<option value=<%=key %>><%=cpMap.get(key) %></option>
						<%
					}									
				%>
				</select> -->
			</td>
			<td>产品名称</td>
			<td  name="notnone">
				<input type=text name=gameName>
			</td>
		</tr>
		<tr>
			<td>产品类型</td>
			<td  name="notnone">
				<select name="networkTypeNum" id="networkTypeNum" class="cplx" onchange="changeFeeCode()">
					<option value=-1>请选择</option>
				<%
					for(AppParameter bean:networktype){
						%>
							<option value=<%=bean.getRemark() %>><%=bean.getName() %></option>
						<%
					}
				%>
				</select>
			</td>
			<td>产品分类</td>
			<td  name="notnone">
				<select name="productCode" id="productCode" class="cpfl">
					<option value=-1>请选择</option>
				<%
					for(AppParameter bean:producttype){
						%>
							<option value=<%=bean.getId() %>><%=bean.getName() %></option>
						<%
					}
				%>
				</select>
			</td>
			
		</tr>
		<tr>
			<td>产品子类型</td>
			<td name="notnone">
				<select name="osCode" id="osCode" class="cpzlx">
					<option value=-1>请选择</option>
				<%
					for(AppParameter bean:ostype){
						%>
							<option value=<%=bean.getRemark() %>><%=bean.getName() %></option>
						<%
					}
				%>
				</select>
			</td>
			<td>支付类型</td>
			<td name="notnone">
				<select id="payCode" name="payCode" onchange="showFeeCode()" class="zflx">
					<option value=-1>请选择</option>
				<%
					for(AppParameter bean:paytype){
						%>
							<option class="singlePay" value=<%=bean.getRemark() %>><%=bean.getName() %></option>
						<%
					}
				%>
				<%
					for(AppParameter bean:onlinepaytype){
						%>
							<option class="netPay" value=<%=bean.getRemark() %>><%=bean.getName() %></option>
						<%
					}
				%>
				</select>
			</td>
		</tr>
		<tr>
			<td>
				<div id="feelabel" style="display:block">计费类型 </div>
			</td>
			<td name="notnone">
			<div  id="feeCodeDiv" style="display:block">
				<select id="feeCode" name="feeCode" onchange="showFeeCode()" class="jflx">
					<option value=-1>请选择</option>
				<%
					for(AppParameter bean:feetype){
						%>
							<option value=<%=bean.getRemark() %>><%=bean.getName() %></option>
						<%
					}
				%>
				</select>
				<input type="hidden" name="propInfo" id="propInfo" value=""/>
			</div>
			</td>
			<td class="g_price">价格</td>
			<td class="g_price"><input type=text name=gamePrice id="billPrice">&nbsp;元</td>
		</tr>
		
		<tr>
			<td>操作方式</td>
			<td  colspan=3  name="notnone">
				<input type="checkbox" name=isRemoteControl value="1" class="operMethod">支持遥控器
				<input type="checkbox" name=isHandle value="1" class="operMethod">支持手柄
				<input type="checkbox" name=isSense value="1" class="operMethod">支持体感
				<input type="checkbox" name=isKeyboard value="1" class="operMethod">支持键盘
				<input type="checkbox" name=isMouse value="1" class="operMethod">支持飞鼠
			</td>			
		</tr>
		
		<tr>
			<td>版权有效日期</td>
			<td colspan=3>
				<input type=text name="effectiveTimeStr" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
			</td>
		</tr>
		
		<tr id="callback">
			<td>短信回调地址：</td>
			<td><input type=text name=smsAddress></td>
			<td>计费回调地址：</td>
			<td><input type=text name=paymentAddress></td>
		</tr>
		<tr>
			<td>游戏介绍</td>
			<td colspan=3 name="notnone">
				<textarea rows="10" cols="50" name="introduction"></textarea>
			</td>
			
		</tr>
		<tr>
			<td>游戏攻略</td>
			<td colspan=3>				
				<input type="file" name=gameStrategy id=gameStrategy>	
				<input type=hidden name=strategy id=strategy value="">
				<a href="javascript:saveFile('gameStrategy','gameStrategy','doc、docx、rar','strategy')" class="btn2">上传</a>	
				<a id="strategyhref" style="display:none;" href="">游戏攻略</a>								
				<span class="red">(请上传*.doc、*.docx或*.rar文件)</span>						
			</td>
			
		</tr>
		<tr>
			<td>游戏DEMO</td>
			<td colspan=3>				
				<input type="file" name=gameDemo id=gameDemo>	
				<input type=hidden name=gameDemoPath id=gameDemoPath value="">
				<a href="javascript:saveFile('gameDemo','gameDemo','jar、apk、cab、rar、zip','gameDemoPath')" class="btn2">上传</a>	
				<a id="gameDemoPathhref" style="display:none;" href="">游戏DEMO</a>	
				<span class="red">(请上传*.jar、*.apk、*.cab、*.rar或*.zip文件)</span>				
			</td>
			
		</tr>
		<tr>
			<td>版权证明</td>
			<td colspan=3>				
				<input type="file" name=copyright id=copyright>	
				<input type=hidden name=copyrightPath id=copyrightPath value="">
				<a href="javascript:saveFile('copyright','copyright','jpg、png、bmp、gif','copyrightPath')" class="btn2">上传</a>	
				<a id="copyrightPathhref" style="display:none;" href="">版权证明</a>	
				<span class="red">(请上传*.jpg、*.png、*.bmp或*.gif文件)</span>						
			</td>			
		</tr>
		<tr>
			<td>jietu1:</td>
			<td colspan=3>
				<input type="file" name=jietu1 id="jietu1">
				<a href="javascript:savePic('jietu1','jietu1',800,480,<%=FileUsedType.GAME_VIEW %>)" class="btn2">上传</a>
				<img id=picIdjietu1 src="" width=200 height=120>
				<input type=hidden name=efsIdjietu1 id=efsIdjietu1>
				<span class="red">图片尺寸：800*480， 图片格式为*.jpg、*.png、*.bmp或*.gif</span>	
				
			</td>			
		</tr>
		<tr>
			<td>jietu2:</td>
			<td colspan=3>
				<input type="file" name=jietu2 id="jietu2">
				<a href="javascript:savePic('jietu2','jietu2',800,480,<%=FileUsedType.GAME_VIEW %>)" class="btn2">上传</a>
				<img id=picIdjietu2 src="" width=200 height=120>
				<input type=hidden name=efsIdjietu2 id=efsIdjietu2>
				<span class="red">图片尺寸：800*480， 图片格式为*.jpg、*.png、*.bmp或*.gif</span>
			</td>			
		</tr>
		<tr>
			<td>jietu3:</td>
			<td colspan=3>
				<input type="file" name=jietu3 id="jietu3">
				<a href="javascript:savePic('jietu3','jietu3',800,480,<%=FileUsedType.GAME_VIEW %>)" class="btn2">上传</a>
				<img id=picIdjietu3 src="" width=200 height=120>
				<input type=hidden name=efsIdjietu3 id=efsIdjietu3>
				<span class="red">图片尺寸：800*480， 图片格式为*.jpg、*.png、*.bmp或*.gif</span>
			</td>			
		</tr>
		<tr>
			<td>jietu4:</td>
			<td colspan=3>
				<input type="file" name=jietu4 id="jietu4">
				<a href="javascript:savePic('jietu4','jietu4',800,480,<%=FileUsedType.GAME_VIEW %>)" class="btn2">上传</a>
				<img id=picIdjietu4 src="" width=200 height=120>
				<input type=hidden name=efsIdjietu4 id=efsIdjietu4>
				<span class="red">图片尺寸：800*480， 图片格式为*.jpg、*.png、*.bmp或*.gif</span>
			</td>			
		</tr>
		<tr>
			<td>pic1:</td>
			<td colspan=3>
				<input type="file" name=pic1 id=pic1>
				<a href="javascript:savePic('pic1','pic1',300,300,<%=FileUsedType.GAME_PHOTO %>)" class="btn2">上传</a>
				<img id=picIdpic1 src="" width=200 height=200>
				<input type=hidden name=efsIdpic1 id=efsIdpic1>
				<span class="red">图片尺寸：300*300， 图片格式为*.jpg、*.png、*.bmp或*.gif</span>				
			</td>			
		</tr>
		
	</table>	
	<div id="propDiv" style="display:block">
		<p><input class="btn2" type="button" onclick="addPropRow()" value="添加道具"></p>
		<table id="propTable">
			<tr>
				<td>道具名称</td>
				<td>功能</td>
				<td>触发条件</td>
				<td>购买指南</td>			
				<td>价格(单位：分)</td>
				<td>消费类型</td>
				<td>操作</td>
			</tr>
			<tr class="proprows">
				<td>
					<input type=text name="chargeName0" class="p_chargeName">
				</td>
				<td>
					<input type=text name="function0" class="p_function">
				</td>
				<td>
					<input type=text name="trigerCondition0" class="p_triger">
				</td>
				<td>
					<input type=text name="bugGuide0" class="p_guide">
				</td>
				<td>
					<input type=text name="price0" class="p_price">
				</td>
				<td>
					<select name="chargeType0" class="p_type">
						<option value="-1">请选择</option>
					<%
						for(AppParameter bean:chargetype){
							%>
								<option value=<%=bean.getRemark() %>><%=bean.getName() %></option>
							<%
						}
					%>
					</select>
				</td>			
				<td>
					<input type=hidden name="list">
					<a href="javascript:void(0)" onclick="deletePropRow(this)">删除</a>
				</td>
			</tr>
		</table>
		
	</div>
	<div id="chargeDiv" style="margin-bottom: 50px;">
		<table id="chargingPoint" class="table2">
			<tr>
				<th>序号</th>
				<th>道具名称</th>
				<th>道具功能</th>
				<th>触发条件</th>
				<th>购买指南</th>	
				<th>价格(单位：分)</th>		
				<th>消费类型</th>
			</tr>
			<tr class="chargePoint">
				<td>1</td>
				<td><input type=text class="p_chargeName" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="100" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="2" readonly="readonly">联网计费点</td>			
			</tr>
			<tr class="chargePoint">
				<td>2</td>
				<td><input type=text class="p_chargeName" value="2元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="2元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="2元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="2元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="200" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="2" readonly="readonly">联网计费点</td>
			</tr>
			<tr class="chargePoint">
				<td>3</td>
				<td><input type=text class="p_chargeName" value="5元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="5元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="5元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="5元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="500" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="2" readonly="readonly">联网计费点</td>	
			</tr>
			<tr class="chargePoint">
				<td>4</td>
				<td><input type=text class="p_chargeName" value="10元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="10元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="10元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="10元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="1000" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="2" readonly="readonly">联网计费点</td>		
			</tr>
			<tr class="chargePoint">
				<td>5</td>
				<td><input type=text class="p_chargeName" value="15元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="15元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="15元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="15元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="1500" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="2" readonly="readonly">联网计费点</td>		
			</tr>
			<tr class="chargePoint">
				<td>6</td>
				<td><input type=text class="p_chargeName" value="20元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="20元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="20元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="20元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="2000" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="2" readonly="readonly">联网计费点</td>	
			</tr>
		</table>
	</div>
	<div id="chargingDiv">
		<table class="table2">
			<tr>
				<th>序号</th>
				<th>道具名称</th>
				<th>道具功能</th>
				<th>触发条件</th>
				<th>购买指南</th>	
				<th>价格(单位：分)</th>		
				<th>消费类型</th>
			</tr>
			<tr class="chargePoint">
				<td>1</td>
				<td><input type=text class="p_chargeName" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_function" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_triger" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_guide" value="1元" readonly="readonly"></td>
				<td><input type=text class="p_price" value="100" readonly="readonly"></td>
				<td><input type=hidden class="p_type" value="1" readonly="readonly">硬计费点</td>		
			</tr>
		</table>
	</div>
	<table>
		<tr>			
				<td colspan=4 align=center>
					<input type="button" value="提交" class="btn3" onclick="formSubmit()">
				</td>			
			</tr>
	</table>
</form>
</div>
</div>
<div class="dialog_table editor_group" id="fileInfo" style="width:400px">
	<form action="<%=request.getContextPath() + "/tv/game/manufacturer/search.do" %>" method="post" id="modelForm" style="height:300px; overflow: auto;">
		<table>
	        	<tr>
	                      <td>厂商名称：</td>
						  <td><input type="text" id="popShortName" name="popShortName" maxlength="30" style="width: 120px;"></td>
	                      <td style="width: 150px;">
	                      	<input type="button" id="upBtn1" class="btn3" style="cursor:hand;width:74px; " name="uploadBtn" value="查询">
	                      </td>
				</tr>
				<tr>
					<table id="searchTable" style="height: 150px;overflow: auto;">
						<tbody>
						</tbody>
					</table>
				</tr>
				<tr>
						<td colspan="8" align="center">
	                      	<input type="button" id="queding" class="btn3" style="cursor:hand;width:74px; " name="uploadBtn" value="确定">
	                      	<input type="button" id="cancel" class="btn3" style="cursor:hand;width:74px;" name="uploadBtn" value="取消">
	                      </td>
				</tr>
		</table>
	</form>
</div>
</div>
</body>
</html>